package org.dfzt.modules.online.cgform.converter;

import java.util.Map;
import org.springframework.stereotype.Component;

@Component("customDemoConverter")
public class c
  implements FieldCommentConverter
{
  @Override
  public String converterToVal(String txt) {
    if (txt != null && txt.equals("管理员1")) {
      return "admin";
    }
    return txt;
  }


  
  @Override
  public String converterToTxt(String val) {
    if (val != null) {
      if (val.equals("admin")) {
        return "管理员1";
      }
      if (val.equals("scott"))
        return "管理员2"; 
    } 
    return val;
  }


  
  @Override
  public Map<String, String> getConfig() { return null; }
}
